/*
 *  Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 *  This source code is licensed under the MIT license found in the LICENSE
 *  file in the root directory of this source tree.
 *
 */

/*
 *  THIS FILE IS AUTOGENERATED. DO NOT MODIFY IT; ALL CHANGES WILL BE LOST IN
 *  VAIN.
 *
 *  @generated
 */

namespace carbon {
namespace test {
namespace A {
namespace thrift {

template <class Writer>
void TestARequest::serialize(Writer&& writer) const {
  writer.writeStructBegin();
  writer.writeField(1 /* field id */, key_ref());
  writer.writeField(2 /* field id */, dummy2_ref());
  writer.writeField(3 /* field id */, ticket_ref());
  writer.writeFieldStop();
  writer.writeStructEnd();
}

template <class V>
void TestARequest::visitFields(V&& v) {
  if (!v.visitField(1, "key", *this->key_ref())) {
    return;
  }
  if (!v.visitField(2, "dummy2", *this->dummy2_ref())) {
    return;
  }
  if (!v.visitField(3, "ticket", this->ticket_ref())) {
    return;
  }
}

template <class V>
void TestARequest::visitFields(V&& v) const {
  if (!v.visitField(1, "key", *this->key_ref())) {
    return;
  }
  if (!v.visitField(2, "dummy2", *this->dummy2_ref())) {
    return;
  }
  if (!v.visitField(3, "ticket", this->ticket_ref())) {
    return;
  }
}

template <class Writer>
void TestAReply::serialize(Writer&& writer) const {
  writer.writeStructBegin();
  writer.writeField(1 /* field id */, result_ref());
  writer.writeField(2 /* field id */, valInt32_ref());
  writer.writeFieldStop();
  writer.writeStructEnd();
}

template <class V>
void TestAReply::visitFields(V&& v) {
  if (!v.visitField(1, "result", *this->result_ref())) {
    return;
  }
  if (!v.visitField(2, "valInt32", *this->valInt32_ref())) {
    return;
  }
}

template <class V>
void TestAReply::visitFields(V&& v) const {
  if (!v.visitField(1, "result", *this->result_ref())) {
    return;
  }
  if (!v.visitField(2, "valInt32", *this->valInt32_ref())) {
    return;
  }
}
} // namespace thrift
} // namespace A
} // namespace test
} // namespace carbon

namespace apache {
namespace thrift {
template <>
class Cpp2Ops<carbon::test::A::TestARequest> {
 public:
  typedef carbon::test::A::TestARequest Type;
  static constexpr protocol::TType thriftType() {
    return protocol::T_STRUCT;
  }
  template <class Protocol>
  static uint32_t write(Protocol* prot, const Type* value) {
    return value->write(prot);
  }
  template <class Protocol>
  static void read(Protocol* prot, Type* value) {
    value->read(prot);
  }
  template <class Protocol>
  static uint32_t serializedSize(Protocol* prot, const Type* value) {
    return value->serializedSize(prot);
  }
  template <class Protocol>
  static uint32_t serializedSizeZC(Protocol* prot, const Type* value) {
    return value->serializedSizeZC(prot);
  }
};

template <>
class Cpp2Ops<carbon::test::A::TestAReply> {
 public:
  typedef carbon::test::A::TestAReply Type;
  static constexpr protocol::TType thriftType() {
    return protocol::T_STRUCT;
  }
  template <class Protocol>
  static uint32_t write(Protocol* prot, const Type* value) {
    return value->write(prot);
  }
  template <class Protocol>
  static void read(Protocol* prot, Type* value) {
    value->read(prot);
  }
  template <class Protocol>
  static uint32_t serializedSize(Protocol* prot, const Type* value) {
    return value->serializedSize(prot);
  }
  template <class Protocol>
  static uint32_t serializedSizeZC(Protocol* prot, const Type* value) {
    return value->serializedSizeZC(prot);
  }
};
} // namespace thrift
} // namespace apache
